package z.HHH;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Teest {
    public static void main(String[] args) {
        Ticket ticket = new Ticket();
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        do {
            executorService.execute(()->ticket.sale());
        }while (ticket.getNum()>0);
    }
}
